package com.lyr.myannotation;

import java.lang.reflect.Method;

public class Test01 {
    public static void main(String[] args) {
        Class type=Student.class;
        try {
            Method m=type.getDeclaredMethod("sayHi");
            MyAnnotation myAnnotation= m.getDeclaredAnnotation(MyAnnotation.class);
            String name=myAnnotation.name();
            String[] courser=myAnnotation.course();
            for (String msg:courser
                 ) {
                System.out.println(msg);

            }
            System.out.println(name);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
